﻿Public Class Clasificacion

    Dim bd As BaseDatos

    Private Sub Clasificacion_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        bd = New BaseDatos
        CargarDatos()
    End Sub

    Private Sub CargarDatos()
        Dim posicion As Integer = 1
        DataGridView1.Rows.Clear()
        Dim listaTorneos As List(Of String)
        Dim datos() As String
        listaTorneos = bd.Consultar("Select * from TemporalClasificacion where IdTorneo = " & FormEntrada.CampeonatoActivo & _
                                    " order by TotalPuntos desc;", "TemporalClasificacion")
        For Each torneo As String In listaTorneos
            datos = Split(torneo, "&")
            DataGridView1.Rows.Add(posicion, datos(3), datos(4), datos(5), datos(6))
            posicion += 1
        Next
    End Sub
End Class